package gui;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;

public class TabSuperContainer extends JPanel {

	private static final long serialVersionUID = 1L;
	private JTabbedPane jTabbedPane = null;

	/**
	 * This is the default constructor
	 */
	public TabSuperContainer() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(900, 620);
		this.setLayout(null);
		jTabbedPane = new JTabbedPane();
		this.add(jTabbedPane);
	}

	public void addTabContainer(TabContainer t) {
		jTabbedPane.add(t.getTabName(), t);
	}

	public void addTab(Tab t) {
		jTabbedPane.add(t.getName(), t.getTab());
	}

	/**
	 * This method initializes jTabbedPane
	 * 
	 * @return javax.swing.JTabbedPane
	 */
	public static void main(String args[]) {
		Tab tab1 = new Tab("t1", new JScrollPane());
		Tab tab2 = new Tab("t2", new JScrollPane());
		Tab tab3 = new Tab("t3", new JScrollPane());
		TabContainer tc1 = new TabContainer("c1");
		TabContainer tc2 = new TabContainer("c2");
		tc1.addComponent(tab1.getName(), tab1.getTab());
		tc1.addComponent(tab2.getName(), tab2.getTab());
		tc2.addComponent("tc1", tc1);
		JFrame f1 = new JFrame();
		f1.setSize(600, 400);
		f1.add(tc2);
		f1.setVisible(true);
	}

}
